package com.itheima.test2;

import java.util.Scanner;

public class StringBuilderDemo2 {
    public static void main(String[] args) {

        //键盘录入
        Scanner scanner = new Scanner(System.in);

        System.out.println("请输入字符串:");
        String str = scanner.next();

        // 判断字符串是否对称
        String result = new StringBuilder().append(str).reverse().toString();

        if (result.equals(str)){
            System.out.println("字符串是对称的");
        }else {
            System.out.println("字符串是非对称的");
        }

    }

}
